package com.seecoder.BlueWhale.vo;

import com.seecoder.BlueWhale.enums.CouponStatusEnum;
import com.seecoder.BlueWhale.po.Coupon;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

@AllArgsConstructor
@Setter
@Getter
public class CouponVO {
    private int id;
    private int userId;
    private int couponGroupId;

    //优惠券状态，0为已使用USED，1为未使用UNUSED
    private CouponStatusEnum couponStatus;

    public CouponVO(int couponGroupId,int userId) {
        this.userId = userId;
        this.couponGroupId = couponGroupId;
        this.couponStatus = CouponStatusEnum.UNUSED;
    }

    public Coupon toPO() {
        Coupon coupon = new Coupon();
        coupon.setCouponGroupId(this.couponGroupId);
        coupon.setCouponStatus(this.couponStatus);
        coupon.setUserId(this.userId);
        return coupon;
    }
}
